package com.md.mapper;

import com.md.entity.DeptInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface DeptMapper {
    @Select("select * from deptinfo")
    List<DeptInfo> selectAll();
    @Select("select * from deptinfo where did = #{did}")
    DeptInfo selectById(int did);
    @Delete("delete from deptinfo where did = #{did}")
    int deleteById(int did);
    @Insert("insert into deptinfo(dname) values(#{dname})")
    int inserts(DeptInfo deptInfo);
    @Update("update deptinfo set dname = #{dname} where did = #{did}")
    int updates(DeptInfo deptInfo);
    @Select("select * from deptinfo where dname like '%${dname}%'")
    List<DeptInfo> selectByName(String dname);
}
